package is.glif.fenius.webui.common;

import java.util.Random;

public class Randomizer {
    private Random rand;
    private Long seed;
    private static Randomizer instance;

    public static Randomizer getInstance(Long seed) {
        if (instance == null) {
            instance = new Randomizer(seed);
        }
        return instance;
    }
    
    public static Randomizer getInstance() {
        if (instance == null) {
            instance = new Randomizer();
        }
        return instance;
    }
    private Randomizer() {
        rand = new Random();
    }
    
    private Randomizer(Long seed) {
        rand = new Random(seed);
        this.setSeed(seed);
    }
    
    
    public void setSeed(Long seed) {
        this.seed = seed;
    }
    public Long getSeed() {
        return seed;
    }
    public Random getRand() {
        return rand;
    }
}
